package com.wkhyapp.lm.contract;

import com.wkhyapp.lm.base.BasePresenter;
import com.wkhyapp.lm.http.ApiCallback;
import com.wkhyapp.lm.http.net.GoodsInfoRequest;
import com.wkhyapp.lm.http.net.GoodsListRequest;
import com.wkhyapp.lm.http.net.SuperResponse;
import com.wkhyapp.lm.http.vo.Goods;

/**
 * Created by fang on 2021/10/13.
 */

public class SharePresenter extends BasePresenter<ShareView> {

    public SharePresenter(ShareView shareView) {
        super(shareView);
    }

    public void getData(Long goodsId){
        GoodsInfoRequest request = new GoodsInfoRequest();
        request.setGoodsId(goodsId);
        addSubscription(apiStores.goodsInfo(request),new ApiCallback<SuperResponse<Goods>>() {
            @Override
            public void onSuccess(SuperResponse<Goods> response) {
                mvpView.setGoods(response.getItem());
            }
            @Override
            public void onFailure(String msg) {
            }
            @Override
            public void onFinish() {
                mvpView.dismissLoad();
            }
        });
    }

}
